<!DOCTYPE html>
<html>
  <head>
    <title>Listing 11.2</title>
    <script type="text/javascript" src="../scripts/assert.js"></script>
    <link href="../styles/assert.css" rel="stylesheet" type="text/css">
  </head>

  <body>
    <script type="text/javascript">

      function bindEvent(element, type, handle) {
        if (element.addEventListener) {
          element.addEventListener(type, handle, false);                //#1
        }
        else if (element.attachEvent) {
          element.attachEvent("on" + type, handle);                     //#2
        }
      }

    </script>

  </body>
</html>
